Skip to content

Conversation

@mirkix
Copy link
Member

@mirkix mirkix commented Apr 21, 2025

This add a new function to AP_Periph. If a heartbeat LED is defined, with set Bit 3 in AP_Periph DEBUG parameter a fast LED flash pattern will make it possible to visual locate the node quick.This can be used to locate the node in your hardware setup if you have more than one DroneCAN node in your setup.
Related to my old PR which I have closed now: #23503

@mirkix mirkix requested a review from tridge April 21, 2025 11:47
last_led_ms = now;

#ifdef HAL_GPIO_PIN_LED
static uint32_t last_led_ms;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we drop this into a flash_led method, please?

static uint32_t next_led_ms = 1000;
if (now - last_led_ms > next_led_ms) {
last_led_ms = now;
if (!no_iface_finished_dna) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean the code will be non-functional, depending on whether it has dna'd or not?


#ifdef HAL_GPIO_PIN_LED
static uint32_t last_led_ms;
static uint32_t next_led_ms = 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static uint32_t next_led_ms = 1000;
static uint32_t current_led_interval_ms = 1000;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants